Skip to content

pkg/types/llo: change ChannelDefinitions.AllowNilStreamValues to DisableNilStreamValues to enable compatible default behaviour#1908

Merged
brunotm merged 1 commit intomainfrom
bm/DS-2118-add-report-range-limits
Mar 19, 2026
Merged

pkg/types/llo: change ChannelDefinitions.AllowNilStreamValues to DisableNilStreamValues to enable compatible default behaviour#1908
brunotm merged 1 commit intomainfrom
bm/DS-2118-add-report-range-limits

Conversation

@brunotm
Copy link
Collaborator

@brunotm brunotm commented Mar 19, 2026

This api attribute is still unused so there is no incompatible changes.

Requires

Supports

…bleNilStreamValues to enable compatible default behaviour
@brunotm brunotm requested a review from a team as a code owner March 19, 2026 13:16
@github-actions
Copy link

👋 brunotm, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-common

⚠️ Breaking Changes (1)

pkg/types/llo.ChannelDefinition (1)
  • AllowNilStreamValues — 🗑️ Removed

✅ Compatible Changes (1)

pkg/types/llo.ChannelDefinition (1)
  • DisableNilStreamValues — ➕ Added

📄 View full apidiff report

@brunotm brunotm requested a review from jmank88 March 19, 2026 15:36
@pavel-raykov pavel-raykov requested a review from Copilot March 19, 2026 15:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames the LLO channel definition flag controlling nil stream-value handling to use a “disable” semantics and JSON field name, aiming to make the default behavior “nil values allowed” and align naming with intended meaning.

Changes:

  • Rename ChannelDefinition.AllowNilStreamValues to ChannelDefinition.DisableNilStreamValues and update equality logic accordingly.
  • Update JSON serialization expectations/tests to use the new disableNilStreamValues field and inverted boolean values.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/types/llo/types.go Renames exported struct field + JSON tag; updates Equals to compare the new field.
pkg/types/llo/types_test.go Updates serialization/value/equality tests to expect disableNilStreamValues in JSON and struct literals.
Comments suppressed due to low confidence (1)

pkg/types/llo/types_test.go:50

  • The serialization round-trip test only covers the new disableNilStreamValues key. Since this PR changes the JSON field name, consider adding a test case that unmarshals legacy JSON containing allowNilStreamValues and verifies it is interpreted equivalently (or explicitly rejected) to avoid silent changes when older payloads are still present.
func Test_ChannelDefinitions_Serialization(t *testing.T) {
	inputJSON := `
{
  "0": {
    "reportFormat": "json",
    "streams": [
	  {"streamId": 1, "aggregator": "median"},
	  {"streamId": 2, "aggregator": "mode"}
    ],
    "opts": null,
    "tombstone": false,
	"source": 1,
	"disableNilStreamValues": true
  },
  "1": {
    "reportFormat": "evm_premium_legacy",
    "streams": [
	  {"streamId": 1, "aggregator": "median"},
	  {"streamId": 2, "aggregator": "median"},
	  {"streamId": 3, "aggregator": "quote"}
    ],
    "opts": {
      "expirationWindow": 86400,
      "multiplier": "1000000000000000000",
      "feedId": "0x0003aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "baseUSDFee": "0.1"
    },
    "tombstone": false,
	"source": 2,
	"disableNilStreamValues": false
  }
}`
	var channelDefinitions ChannelDefinitions
	err := json.Unmarshal([]byte(inputJSON), &channelDefinitions)
	require.NoError(t, err)

	marshaledJSON, err := json.Marshal(channelDefinitions)
	require.NoError(t, err)

	assert.JSONEq(t, inputJSON, string(marshaledJSON))

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +263 to +267
// DisableNilStreamValues controls whether channels with nil stream values
// are considered reportable. When true, nil stream values are disabled
// (channel not reportable until all values present). When false (default),
// nil stream values are allowed and the report codec needs to handle them accordingly.
DisableNilStreamValues bool `json:"disableNilStreamValues"`
@brunotm brunotm added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 325b015 Mar 19, 2026
34 of 35 checks passed
@brunotm brunotm deleted the bm/DS-2118-add-report-range-limits branch March 19, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants